/**
  * Copyright 2019 bejson.com 
  */
package com.xingkeduo.dto.transter.appointment;

import com.xingkeduo.utils.ResponseUtils;
import lombok.Data;

@Data
public class AppointmentSubmit {

    private int error;
    private Object reason;
    private Object content;


    public void covert(ResponseUtils appointment) {
        this.error=appointment.getStatus()==1?0:1;
        this.reason = appointment.getMsg();
        this.content=appointment.getMsg();


        if("活动或价格不一致".equals(appointment.getMsg())){
            this.error=10001;
            this.reason="活动id不一致";
            this.content="活动id不一致";
        }

        if("您有未完成服务的订单".equals(appointment.getMsg())){
            this.error=1001;
            this.reason="您有未完成服务的订单，请完成后预约。";
            this.content="您有未完成服务的订单，请完成后预约。";
        }


        if("订单状态已经改变".equals(appointment.getMsg())){
            this.error=1501;
            this.reason="订单状态已经改变，不能修改预约时间。";
            this.content="订单状态已经改变，不能修改预约时间。";
        }
    }
}